package org.example.oop;

/**
 * 矩形
 */
public class Rectangle extends Shape{//alt+enter
    /**
     * 宽度
     */
    private double width;
    /**
     * 高度
     */
    private double height;

    public Rectangle(String color,double width,double height){
        super(color);
        this.width=width;
        this.height=height;
    }

    @Override
    double doArea() {
      return width*height;
    }
    @Override
    double doPerimeter() {
        return 2 * (width + height);
    }
}
